/**
 * 统一传输进度组件样式
 * 基于下载进度样式，支持上传和下载双模式
 */

.transfer-progress {
  background: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.transfer-progress:hover {
  border-color: #d9d9d9;
  background: #fafafa;
}

/* 传输类型特定样式 */
.transfer-progress.transfer-upload {
  border-left: 3px solid #52c41a;
}

.transfer-progress.transfer-download {
  border-left: 3px solid #1890ff;
}

/* 传输头部 */
.transfer-progress .transfer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.transfer-progress .transfer-file-info {
  flex: 1;
  min-width: 0;
}

.transfer-progress .transfer-file-name-row {
  margin-bottom: 2px;
}

.transfer-progress .transfer-file-name-row .anticon {
  color: rgba(0, 0, 0, 0.45);
  margin-right: 4px;
  font-size: 12px;
}

.transfer-upload .transfer-file-name-row .anticon-upload {
  color: #52c41a;
}

.transfer-download .transfer-file-name-row .anticon-download {
  color: #1890ff;
}

.transfer-progress .transfer-file-name {
  display: inline-block;
  color: rgba(0, 0, 0, 0.88) !important;
  font-size: 12px;
  word-break: break-all;
  max-width: 300px;
  line-height: 1.4;
}

.transfer-progress .transfer-file-details {
  display: flex;
  gap: 6px;
  align-items: center;
}

.transfer-progress .transfer-file-size {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45) !important;
}

.transfer-progress .transfer-file-extra {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45) !important;
  font-style: italic;
}

/* 传输操作按钮 */
.transfer-progress .transfer-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 6px;
}

.transfer-progress .transfer-action-button {
  color: rgba(0, 0, 0, 0.45) !important;
  border: none !important;
  background: transparent !important;
  padding: 2px !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
}

.transfer-progress .transfer-action-button:hover {
  color: rgba(0, 0, 0, 0.75) !important;
  background: #f5f5f5 !important;
}

.transfer-progress .transfer-cancel-button:hover {
  color: #ff4d4f !important;
}

/* 进度条区域 */
.transfer-progress .transfer-progress-section {
  margin-bottom: 3px;
}

.transfer-progress .transfer-progress-section .ant-progress {
  margin-bottom: 4px;
}

.transfer-progress .transfer-progress-section .ant-progress-bg {
  background: #f5f5f5 !important;
}

.transfer-progress .transfer-progress-section .ant-progress-inner {
  background: #f5f5f5 !important;
  border-radius: 3px;
  height: 4px !important;
}

/* 进度信息 */
.transfer-progress .transfer-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.transfer-progress .transfer-progress-info .ant-space {
  flex: 1;
}

.transfer-progress .transfer-progress-info .ant-typography {
  color: rgba(0, 0, 0, 0.45) !important;
  font-size: 10px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.transfer-progress .transfer-separator {
  color: rgba(0, 0, 0, 0.25);
  margin: 0 3px;
}

.transfer-progress .transfer-status-text {
  font-weight: 500 !important;
}

/* 状态标签区域 */
.transfer-progress .transfer-status-tags-section {
  margin-top: 6px;
  padding: 4px 0;
  border-top: 1px solid #f0f0f0;
}

.transfer-progress .transfer-status-tags-section .ant-tag {
  margin: 0 !important;
  font-size: 9px !important;
  line-height: 14px !important;
  padding: 0 4px !important;
  border-radius: 6px !important;
  height: 16px !important;
}

/* 错误消息 */
.transfer-progress .transfer-error-message {
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(255, 77, 79, 0.1);
  border: 1px solid rgba(255, 77, 79, 0.3);
  border-radius: 4px;
}

.transfer-progress .transfer-error-text {
  font-size: 11px !important;
  color: #ff4d4f !important;
  margin: 0 !important;
}

/* 状态特定样式 */
.transfer-progress[data-status="completed"] {
  border-color: rgba(82, 196, 26, 0.3);
  background: rgba(82, 196, 26, 0.05);
}

.transfer-progress[data-status="error"] {
  border-color: rgba(255, 77, 79, 0.3);
  background: rgba(255, 77, 79, 0.05);
}

.transfer-progress[data-status="paused"] {
  border-color: rgba(250, 173, 20, 0.3);
  background: rgba(250, 173, 20, 0.05);
}

.transfer-progress[data-status="cancelled"] {
  border-color: rgba(140, 140, 140, 0.3);
  background: rgba(140, 140, 140, 0.05);
  opacity: 0.7;
}

/* 上传特定样式增强 */
.transfer-upload[data-status="uploading"] {
  border-left-color: #52c41a;
}

.transfer-upload[data-status="completed"] {
  border-left-color: #389e0d;
}

/* 下载特定样式增强 */
.transfer-download[data-status="downloading"] {
  border-left-color: #1890ff;
}

.transfer-download[data-status="completed"] {
  border-left-color: #096dd9;
}

/* 笔记本屏幕优化 (1366x768 等常见分辨率) */
@media (max-height: 800px) {
  .transfer-progress {
    padding: 6px;
    margin-bottom: 4px;
  }

  .transfer-progress .transfer-header {
    margin-bottom: 4px;
  }

  .transfer-progress .transfer-file-name-row {
    margin-bottom: 1px;
  }

  .transfer-progress .transfer-file-name {
    font-size: 11px;
    line-height: 1.3;
  }

  .transfer-progress .transfer-file-size,
  .transfer-progress .transfer-file-extra {
    font-size: 9px;
  }

  .transfer-progress .transfer-progress-section {
    margin-bottom: 2px;
  }

  .transfer-progress .transfer-progress-section .ant-progress {
    margin-bottom: 3px;
  }

  .transfer-progress .transfer-progress-section .ant-progress-inner {
    height: 3px !important;
  }

  .transfer-progress .transfer-progress-info {
    font-size: 9px;
  }

  .transfer-progress .transfer-progress-info .ant-typography {
    font-size: 9px !important;
  }

  .transfer-progress .transfer-status-tags-section {
    margin-top: 4px;
    padding: 3px 0;
  }

  .transfer-progress .transfer-status-tags-section .ant-tag {
    font-size: 8px !important;
    line-height: 12px !important;
    height: 14px !important;
    padding: 0 3px !important;
  }

  .transfer-progress .transfer-action-button {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
  }
}

/* 响应式设计 */
@media (max-width: 480px) {
  .transfer-progress {
    padding: 8px;
  }
  
  .transfer-progress .transfer-header {
    flex-direction: column;
    gap: 8px;
  }

  .transfer-progress .transfer-actions {
    align-self: flex-end;
    margin-left: 0;
  }

  .transfer-progress .transfer-file-name {
    max-width: 200px;
  }

  .transfer-progress .transfer-file-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .transfer-progress .transfer-progress-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .transfer-progress .transfer-progress-info .ant-space {
    flex-direction: column;
    align-items: flex-start;
  }

  .transfer-progress .transfer-status-tags-section {
    margin-top: 6px !important;
    padding-top: 4px !important;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .transfer-progress .transfer-action-button {
    width: 32px !important;
    height: 32px !important;
    padding: 6px !important;
  }

  .transfer-progress .transfer-actions {
    gap: 8px;
  }
}

/* 暗色主题优化 */
@media (prefers-color-scheme: dark) {
  .transfer-progress {
    background: #1f1f1f;
    border-color: #434343;
  }

  .transfer-progress:hover {
    background: #262626;
    border-color: #595959;
  }

  .transfer-progress .transfer-file-name-row .anticon {
    color: rgba(255, 255, 255, 0.45);
  }

  .transfer-progress .transfer-file-name {
    color: rgba(255, 255, 255, 0.85) !important;
  }

  .transfer-progress .transfer-file-size,
  .transfer-progress .transfer-file-extra {
    color: rgba(255, 255, 255, 0.45) !important;
  }

  .transfer-progress .transfer-action-button {
    color: rgba(255, 255, 255, 0.45) !important;
  }

  .transfer-progress .transfer-action-button:hover {
    color: rgba(255, 255, 255, 0.85) !important;
    background: #262626 !important;
  }

  .transfer-progress .transfer-progress-section .ant-progress-inner {
    background: #141414 !important;
  }

  .transfer-progress .transfer-progress-section .ant-progress-bg {
    background: #434343 !important;
  }

  .transfer-progress .transfer-progress-info .ant-typography {
    color: rgba(255, 255, 255, 0.45) !important;
  }

  .transfer-progress .transfer-separator {
    color: rgba(255, 255, 255, 0.25);
  }

  .transfer-progress .transfer-status-tags-section {
    border-top-color: #434343;
  }

  .transfer-progress .transfer-error-message {
    background: rgba(255, 77, 79, 0.15);
    border-color: rgba(255, 77, 79, 0.4);
  }
}

/* 动画效果 */
.transfer-progress[data-status="uploading"] .transfer-file-name-row .anticon-upload,
.transfer-progress[data-status="downloading"] .transfer-file-name-row .anticon-download {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* 压缩和并行状态的特殊效果 */
.transfer-progress .transfer-status-tags-section .ant-tag[color="processing"] {
  animation: processing 1.5s infinite;
}

@keyframes processing {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
